<!--  -->
<template>
  <common-card title="今日交易用户数" :value="1.0">
    <template>
      <div id="todayUsers" :style="{ height: '100%', width: '100%' }"></div>
    </template>
    <template v-slot:footer>
      <span>退货率</span>
      <span class="emphasis">0.00</span>
    </template>
  </common-card>
</template>

<script>
import commonCardMixin from '../../mixins/commonCardMixins'
export default {
  mixins: [commonCardMixin],
  data() {
    return {}
  },
  mounted() {
    this.getOptions()
  },
  methods: {
    getOptions() {
      let mychart = this.$echarts.init(document.getElementById('todayUsers'))
      let option = {
        color: ['#3398DB'],
        tooltip: {},
        series: [
          {
            name: '用户实时交易量',
            type: 'bar',
            data: [
              '200',
              '300',
              '300',
              '300',
              '300',
              '300',
              '300',
              '300',
              '300',
              '300',
              '300',
            ],
            barWidth: '60%',
          },
        ],
        xAxis: {
          type: 'category',
          data: [
            '00.00',
            '01.00',
            '02.00',
            '03.00',
            '04.00',
            '05.00',
            '06.00',
            '07.00',
            '08.00',
            '09.00',
            '10.00',
          ],
          show: false,
        },
        yAxis: {
          show: false,
        },
        grid: {
          top: 0,
          left: 0,
          bottom: 0,
          right: 0,
        },
      }
      mychart.setOption(option, true)
      window.onresize = mychart.resize
    },
  },
}
</script>
<style lang="less" scoped>
.compare-wrapper {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  .compare {
    display: flex;
    align-items: center;
    font-size: 12px;
    margin-top: 13px;
    color: #666;
  }
}
</style>
